package cn.myjerry.pattern.singleton;

/**
 * 测试懒汉式单例模式
 * @author Jerry
 *
 */
public class SingletonDemo02 {

	private static SingletonDemo02 instance;
	
	private SingletonDemo02() {}
	
	public static synchronized SingletonDemo02 getInstance() {
		if(instance == null) {
			instance = new SingletonDemo02();
		}
		return instance;
	}
	
}
